wayland: Fix toplevel lookup before starting DnD
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Nov 2015 19:26:11 +0000 (20:26 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Nov 2015 22:27:26 +0000 (23:27 +0100)
We use the high-level gdk_device_get_window_at_position() to figure
out the window, although this one actually tries to find out the
current window under the device coordinates, which might well fall
outside the window, so NULL is returned in those cases.

Fix this by using the lower level _gdk_device_window_at_position()
that will return the toplevel without further lookups, so is more
desirable here.

https://bugzilla.gnome.org/show_bug.cgi?id=758250

gdk/wayland/gdkdnd-wayland.c

index 835b6d08e25a87b6706186c1a0f7c497c644a29a..6f95b076a95d410767b41e05eb7d4ae12a354b80 100644 (file)
@@ -25,6 +25,8 @@
 #include "gdkprivate-wayland.h"
 #include "gdkdisplay-wayland.h"
 
+#include "gdkdeviceprivate.h"
+
 #include <string.h>
 
 #define GDK_TYPE_WAYLAND_DRAG_CONTEXT              (gdk_wayland_drag_context_get_type ())
@@ -350,7 +352,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
   GdkWindow *toplevel;
   GList *l;
 
-  toplevel = gdk_device_get_window_at_position (device, NULL, NULL);
+  toplevel = _gdk_device_window_at_position (device, NULL, NULL, NULL, TRUE);
 
   context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
   context = GDK_DRAG_CONTEXT (context_wayland);